{template 'common/header'}
{template 'user_header'}
<style>
	#modeladd li,#modelal li{ padding-top:5px; padding-bottom:5px; list-style: none;}
	.t_input{ height:30px; border: 1px solid #cccc; line-height: 30px; border-radius: 5px;}
</style>
{if $op == 'edit'}
<div class="main">
	
	<div class="panel panel-default">
		<div class="panel-heading">投诉信息</div>
		<div class="panel-body">
		   <div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 control-label">头像</label>
				<div class="col-xs-12 col-sm-9">
					{if $usershow[avatar]}
					<img src="{php echo tomedia($usershow[avatar]);}" onerror="this.src='./resource/images/nopic.jpg'; this.title='缩略图片未上传.'" style="max-width:80px;"/>
					{else}
					<img src="../addons/{$_GPC['m']}/template/noavatar_middle.gif" style="max-width:80px;"/>
					{/if}
				</div>
			</div>

		   <div class="form-group">
				<label class="col-sm-2 control-label">公司名称</label>
				<div class="col-sm-10">
				  <p class="form-control-static">{$user_comp['compname']}</p>
				</div>
			</div>
			
			<div class="form-group">
				<label class="col-sm-2 control-label">投诉名称</label>
				<div class="col-sm-10">
				  <p class="form-control-static">{$srdb['titlename']}</p>
				</div>
			</div>
			
			<div class="form-group">
				<label class="col-sm-2 control-label">投诉内容</label>
				<div class="col-sm-10">
				  <p class="form-control-static">{$srdb['content']}</p>
				</div>
			</div>
			
		</div>
	</div>
	<div class="form-group col-sm-12 col-xs-12">
		<a href="{php echo $this->createWebUrl('user_toushu');}" class="btn btn-primary col-lg-1">返回</a>
	</div>
	
</div>

{else}

<div class='main'>
   	<div class="panel panel-info">
		<div class="panel-heading">筛选</div>
		<div class="panel-body">
			<form action="./index.php" method="get" class="form-inline" role="form">
			<input type="hidden" name="c" value="{$_GPC['c']}">
			<input type="hidden" name="a" value="{$_GPC['a']}">
			<input type="hidden" name="do" value="{$_GPC['do']}">
			<input type="hidden" name="m" value="{$_GPC['m']}">
			  <div class="form-group">
				<label for="exampleInputEmail2">关键字</label>
				<input type="txt" class="form-control" name="keyword"  value="{$_GPC['keyword']}">
			  </div>
			  <div class="form-group">
				<label for="exampleInputEmail2">结果排序</label>
				<select name="ordersc" class="form-control">
					<option value="" >不限</option>
					<option value="desc" $ordersc[desc] >递减</option>
					<option value="asc" $ordersc[asc] >递增</option>
				</select>
				<select name="psize" class="form-control">
					<option value="20" $perpages[20]>每页显示20个</option>
					<option value="50" $perpages[50]>每页显示50个</option>
					<option value="100" $perpages[100]>每页显示100个</option>
				</select>
			  </div>
			  <button type="submit" class="btn btn-default">搜索</button>
			</form>

		</div>
	</div>
</div>

<script language="javascript" type="text/javascript">
	function checkAll(form, name) {
		for(var i = 0; i < form.elements.length; i++) {
			var e = form.elements[i];
			if(e.name.match(name)) {
				e.checked = form.elements['chkall'].checked;
			}
		}
	}
</script>

<div class="panel panel-default">
  <div class="panel-body">
    <form method="post" class="form">
	<input name="token" type="hidden" value="{$_W['token']}" />
	<div class="table-responsive">
	  <table class="table">
		<tr>
			<th width="80">选择</th>
			<th>标题</th>
			<th>发布时间</th>
			<th width="150">操作</th>
		</tr>
		{loop $list $key $value}
		<tr >
			<td><input type="checkbox" name="ids[]" value="{$value[id]}"></td>
			<td>{$value['titlename']}</td>
			<td>{php echo date('Y-m-d H:i', $value['dateline']);}</td>
			<td>
				<a href="{php echo $this->createWebUrl('user_toushu', array('op' => 'edit', 'id' => $value[id]))}">查看</a> &nbsp;|&nbsp; 
				<a href="{php echo $this->createWebUrl('user_toushu', array('op' => 'delete', 'id' => $value[id]))}">删除</a>
			</td>
		</tr>
		{/loop}
		{if $pager}
		<tr >
			<td colspan="4">{$pager}</td>
		</tr>
		{/if}
		<tr >
			<td colspan="4" align="center">
				<input type="checkbox" id="chkall" name="chkall" onclick="checkAll(this.form, 'ids')">全选 &nbsp;&nbsp;
				<input type="radio" name="optype" value="1">删除
				<input type="submit" name="listsubmit" value="提交" class="btn btn-default">
			</td>
		 </tr>
	  </table>
	</div>
	</form>
  </div>
</div>
{/if}

{template 'common/footer'}